﻿using System;
using System.Collections.Generic;
using System.ServiceModel;
using System.ServiceModel.Web;
using MedicalAdviser.Portable.DataTypes;
using MedicalAdviser.Portable.DataTypes.DomainObjects;
using MedicalAdviser.Portable.DataTypes.WsTypes;

namespace MedicalAdviser.Interfaces.WsInterfaces
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IAdviserOperations" in both code and config file together.
    [ServiceContract]
    public interface IAdviserOperations
    {
        [OperationContract]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, UriTemplate = "/teste")]
        String DoWork();

        [OperationContract]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "/json/{id}")]
        String GetMyName(String id);


        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, UriTemplate = Endpoints.LOGIN)]
        ServiceOut<Auth> Login( Auth auth);

        [OperationContract]
        [WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json,  BodyStyle = WebMessageBodyStyle.Bare, UriTemplate = Endpoints.LOGOUT)]
        ServiceOut<Auth> Logout(Auth auth);

        [OperationContract]
        [WebInvoke(Method = "POST", 
        ResponseFormat = WebMessageFormat.Json, 
        RequestFormat = WebMessageFormat.Json, 
        BodyStyle = WebMessageBodyStyle.Bare,
        UriTemplate = Endpoints.QUICK_SEARCH)]
        ServiceOut<List<CdoDrug>> QuickSearch(SearchDrug search);

        [OperationContract]
        [WebInvoke(Method = "POST",
        ResponseFormat = WebMessageFormat.Json,
        RequestFormat = WebMessageFormat.Json,
        BodyStyle = WebMessageBodyStyle.Bare,
        UriTemplate = Endpoints.REFINED_SEARCH)]
        ServiceOut<SearchResult> RefinedSearch(SearchDrug search );

        [OperationContract]
        [WebInvoke(Method = "POST",
        ResponseFormat = WebMessageFormat.Json, 
        RequestFormat = WebMessageFormat.Json,
        BodyStyle = WebMessageBodyStyle.Bare,
        UriTemplate = Endpoints.RECOMENDATION_DRUG)]
        ServiceOut<int> ReccomendDrug(AppInteration tInput);


        [OperationContract]
        [WebInvoke(Method = "POST",
        ResponseFormat = WebMessageFormat.Json,
        RequestFormat = WebMessageFormat.Json,
        BodyStyle = WebMessageBodyStyle.Bare,
        UriTemplate = Endpoints.SEARCH_KEYWORD)]
        ServiceOut<int> SearchKeyword(AppInteration tInput);


        [OperationContract]
        [WebInvoke(Method = "POST",
        ResponseFormat = WebMessageFormat.Json,
        RequestFormat = WebMessageFormat.Json,
        BodyStyle = WebMessageBodyStyle.Bare,
        UriTemplate = Endpoints.VIEW_DRUG)]
        ServiceOut<int> ViewDrug(AppInteration tInput);

        [OperationContract]
        [WebInvoke(Method = "POST",
        ResponseFormat = WebMessageFormat.Json,
        RequestFormat = WebMessageFormat.Json,
        BodyStyle = WebMessageBodyStyle.Bare,
        UriTemplate = Endpoints.OPEN_DRUG)]
        ServiceOut<CdoDrug> OpenDrug(AppInteration tInput);

        [OperationContract]
        [WebInvoke(Method = "POST",
        ResponseFormat = WebMessageFormat.Json,
        RequestFormat = WebMessageFormat.Json,
        BodyStyle = WebMessageBodyStyle.Bare,
        UriTemplate = Endpoints.EQUIVALENTS_LOW_COST_DRUGS)]
        ServiceOut<List<CdoDrug>> EquivalentsLowCostDrugs(AppInteration tInput);

        [OperationContract]
        [WebInvoke(Method = "POST",
        ResponseFormat = WebMessageFormat.Json,
        RequestFormat = WebMessageFormat.Json,
        BodyStyle = WebMessageBodyStyle.Bare,
        UriTemplate = Endpoints.EQUIVALENTS_MOST_RECOMENDATION_DRUGS)]
        ServiceOut<List<CdoDrug>> EquivalentMostRecommendationDrugs(AppInteration tInput);

        [OperationContract]
        [WebInvoke(Method = "POST",
        ResponseFormat = WebMessageFormat.Json,
        RequestFormat = WebMessageFormat.Json,
        BodyStyle = WebMessageBodyStyle.Bare,
        UriTemplate = Endpoints.DRUG_PRICE_VARIATIONS)]
        ServiceOut<List<PriceHistory>> PriceVariations(AppInteration tInput);



    }
}
